<template>
  <div class="details">
    <header>
      <p>
        <img
          class="imgp"
          @click="handou"
          src="https://z3.ax1x.com/2021/07/20/WUkII0.png"
          alt=""
        />
      </p>
      <p>
        <img class="woimg" :src="userimg" alt="" /><span @click="handolKlick"
          >编辑资料</span
        >
      </p>
      <p class="p3">{{ username }}</p>
      <p class="vip">vip</p>
      <ul>
        <li>动态<span>0</span></li>
        <li>关注<span>0</span></li>
        <li>粉丝<span>3</span></li>
        <li>获赞<span>0</span></li>
      </ul>
    </header>
    <main>
      <div>
        <div class="mtop">
          <div class="wo">
            <div style="margin-left: 8px; color: #000000">我的宣章</div>
            <div class="right">
              <img src="https://z3.ax1x.com/2021/07/21/WUa5jg.png" alt="" />
              <img src="https://z3.ax1x.com/2021/07/21/WUa7Hs.png" alt="" />
            </div>
          </div>
          <div class="mtoptt">
            <p>最近在学</p>
            <ul>
              <li>
                <img src="https://z3.ax1x.com/2021/07/21/WU0UNn.png" alt="" />
                <p>西南联求...</p>
              </li>
              <li>
                <img src="https://z3.ax1x.com/2021/07/21/WUDHfI.png" alt="" />
                <p>光环效应</p>
              </li>
              <li>
                <img src="https://z3.ax1x.com/2021/07/21/WUDvnS.png" alt="" />
                <p>高效能人士...</p>
              </li>
            </ul>
          </div>
        </div>
        <div class="mbtn">
          <h5>回答·1</h5>
          <ul>
            <li>
              <img class="woing22" :src="userimg" alt="" />
              <p>
                <span>{{ username }}</span>
                <span>今天{{ hour }}:{{ minu }}</span>
              </p>
            </li>
          </ul>
          <div class="p5">
            <p class="pp">
              你记忆中印象最深的一个暑假是怎样的？如果
              你有孩子，你会希望如何安排他的暑假？
            </p>
            <p class="ppp">我没有孩子，我不知道</p>
            <p class="pppp">
              <img
                src="https://z3.ax1x.com/2021/07/21/WU4SfS.png"
                alt=""
              /><span>赞同</span
              ><img src="https://z3.ax1x.com/2021/07/21/WU4iOs.png" alt="" />
            </p>
          </div>
        </div>
      </div>
    </main>
    <footer>页面有尽头，学习无止境</footer>
  </div>
</template>
<script>
import { onBeforeMount } from "@vue/runtime-core";
import { useRouter } from "vue-router";
import { postEditChaXunApi } from "../utils/loginapi";
import { ref } from "vue";
export default {
  setup() {
    const router = useRouter();
    const now = new Date();
    var hour = now.getHours();
    var minu = now.getMinutes();
    const token = localStorage.getItem("token");
    const username = ref("");
    const userimg = ref("");
    onBeforeMount(() => {
      postEditChaXunApi({ usertel: token }).then((res) => {
        username.value = res.data.username;
        userimg.value = res.data.userimg;
      });
    });
    const handolKlick = () => {
      router.push("/edit");
    };
    const handou = () => {
      router.go(-1);
    };
    return {
      hour,
      minu,
      handolKlick,
      handou,
      token,
      username,
      userimg,
    };
  },
};
</script>

<style lang="less">
.details {
  .woimg {
    width: 45px;
    height: 40px;
    margin-left: 30px;
    border-radius: 50%;
  }
  .imgp {
    margin-left: 10px;
    margin-top: 10px;
  }
  color: #fefefe;
  font-family: PingFangSC;
  font-weight: 600;
  font-size: 12px;
  display: flex;
  flex-direction: column;
  background: #ffffff;

  header {
    height: 214px;
    width: 100%;
    background: linear-gradient(to right, #808080, #808080, #000000);
    display: flex;
    flex-direction: column;
    justify-content: space-evenly;
    p:nth-child(1) {
      margin-left: 11px;
    }
    p:nth-child(2) {
      display: flex;
      justify-content: space-between;
      align-items: center;
      span {
        border-radius: 10px;
        border: 1px solid white;
        width: 65px;
        height: 30px;
        line-height: 25px;
        margin-right: 20px;
        text-align: center;
      }
    }

    img {
      margin-left: 15px;
    }

    .p3 {
      font-size: 15px;
      margin-left: 19px;
    }
    .vip {
      margin-top: -10px;
      margin-left: 40px;
      color: lightgrey;
      font-style: italic;
    }

    ul {
      display: flex;
      justify-content: space-evenly;
      li {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: space-evenly;
        width: 25%;
        height: 50px;
      }
    }
  }
  main {
    color: black;
    height: 100%;
    width: 100%;
    background: #eeeeee;

    .mtop {
      height: 220px;
      background: #ffffff;
      width: 100%;
      border-radius: 10px 10px 0 0;
      margin-top: -10px;
      padding: 0 10px;
      .mtoptt {
        height: 150px;
        display: flex;
        flex-direction: column;
        justify-content: space-evenly;
        ul {
          display: flex;

          li {
            text-align: center;
            margin-right: 10px;
            img {
              border: 1px dashed lightgrey;
            }
            p {
              color: #62605f;
              text-overflow: ellipsis;
              white-space: nowrap;
              overflow: hidden;
              width: 70px;
            }
          }
        }
      }
      .wo {
        height: 50px;
        width: 100%;
        display: flex;
        justify-content: space-between;
        align-items: center;
        border-bottom: 1px solid lightgray;

        padding: 0 10px;

        .right {
          display: flex;
          width: 50px;
          justify-content: space-evenly;
          align-items: center;

          img:nth-child(2) {
            width: 7px;
            height: 10px;
          }
        }
      }
    }
    .mbtn {
      height: 100px;
      width: 100%;
      background: #ffffff;
      margin-top: 20px;
      padding: 0 9px;
      h5 {
        font-size: 14px;
        padding-top: 8px;
      }
      ul {
        display: flex;

        li {
          display: flex;
          justify-content: space-evenly;
          align-items: center;
          img {
            height: 27px;
            width: 27px;

            margin-right: 5px;
          }
          p {
            display: flex;
            flex-direction: column;
            justify-content: space-evenly;
            height: 55px;

            font-size: 14px;
            span:nth-child(2) {
              font-size: 10px;
              margin-top: -7px;
              color: #9d9d9d;
            }
          }
        }
      }
      .p5 {
        padding-bottom: 10px;
        .pp {
          width: 80%;
          margin-left: 50px;
          background: #ffffff;
          border-radius: 8px;
          line-height: 28px;
          color: #4f4c4b;
          font-size: 14px;
        }
        .ppp {
          margin-top: 15px;
          color: #4f4c4b;
          margin-left: 50px;
          font-size: 10px;
        }
        .pppp {
          color: #eeeeee;
          display: flex;
          justify-content: flex-end;
          padding-top: 35px;
          margin-bottom: 50px;
          img {
            margin: 0 5px;
          }
          span {
            margin-right: 10px;
          }
        }
      }
    }
  }
  footer {
    width: 100%;
    height: 50px;
    position: fixed;
    bottom: 0px;
    background: #eeeeee;
    font-size: 15px;
    color: black;
    font-weight: 800px;
    text-align: center;
    line-height: 60px;
  }
}
</style>
